﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年3月3日
//类描述：实体类 Equip_MsgSent (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年3月3日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.PreAlarm.Model
{
    /// <summary>
    /// 实体类 Equip_MsgSent (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "Equip_MsgSent", PrimaryKey = "Equip_No", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class Equip_MsgSentInfo : BaseModel
    {
        public Equip_MsgSentInfo()
        {            
            PrimaryKey = "Equip_No"; 
			Fields.Add("Equip_No");//设备编号
			Fields.Add("Msg_SendTime");//信息发布时间
			Fields.Add("Msg_No");//信息编号
			Fields.Add("Msg_RecStatus");//信息接收状态
			Fields.Add("Ext");//备用字段
			
			
			CanNotNullFields.Add("Equip_No");//设备编号不能为空!				
			
			CanNotNullFields.Add("Msg_SendTime");//信息发布时间不能为空!				
			
			CanNotNullFields.Add("Msg_No");//信息编号不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public Equip_MsgSentInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
        }
        #endregion 
		
		#region 成员变量
				
		private string _Equip_No;//设备编号
		private DateTime _Msg_SendTime;//信息发布时间
		private string _Msg_No;//信息编号
		private byte _Msg_RecStatus;//信息接收状态
		private string _Ext;//备用字段
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// 设备编号
        /// </summary>       
		[ModelField(Description = "设备编号", Type = typeof(string), ErrorMessage = "设备编号信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 16,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Equip_No
        {
            get
            {
                return this._Equip_No;
            }
            set
            {
                if (_Equip_No != value || (_Equip_No == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_MsgSent", "Equip_No", _Equip_No, value, "varchar", "设备编号");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnEquip_NoChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Equip_No = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnEquip_NoChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Equip_No = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 信息发布时间
        /// </summary>       
		[ModelField(Description = "信息发布时间", Type = typeof(DateTime), ErrorMessage = "信息发布时间信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 8,  DbType = "datetime", IsNeedRecordModify = true)]
        public virtual DateTime Msg_SendTime
        {
            get
            {
                return this._Msg_SendTime;
            }
            set
            {
                if (_Msg_SendTime != value || (_Msg_SendTime == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_MsgSent", "Msg_SendTime", _Msg_SendTime, value, "datetime", "信息发布时间");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnMsg_SendTimeChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Msg_SendTime = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnMsg_SendTimeChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Msg_SendTime = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 信息编号
        /// </summary>       
		[ModelField(Description = "信息编号", Type = typeof(string), ErrorMessage = "信息编号信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Msg_No
        {
            get
            {
                return this._Msg_No;
            }
            set
            {
                if (_Msg_No != value || (_Msg_No == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_MsgSent", "Msg_No", _Msg_No, value, "varchar", "信息编号");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnMsg_NoChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Msg_No = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnMsg_NoChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Msg_No = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 信息接收状态
        /// </summary>       
		[ModelField(Description = "信息接收状态", Type = typeof(byte), ErrorMessage = "信息接收状态信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 1,  DbType = "tinyint", IsNeedRecordModify = true)]
        public virtual byte Msg_RecStatus
        {
            get
            {
                return this._Msg_RecStatus;
            }
            set
            {
                if ( IsNew || _Msg_RecStatus != value || (_Msg_RecStatus == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_MsgSent", "Msg_RecStatus", _Msg_RecStatus, value, "tinyint", "信息接收状态");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnMsg_RecStatusChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Msg_RecStatus = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnMsg_RecStatusChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Msg_RecStatus = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 备用字段
        /// </summary>       
		[ModelField(Description = "备用字段", Type = typeof(string), ErrorMessage = "备用字段信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string Ext
        {
            get
            {
                return this._Ext;
            }
            set
            {
                if (_Ext != value || (_Ext == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_MsgSent", "Ext", _Ext, value, "nvarchar", "备用字段");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnExtChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Ext = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnExtChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Ext = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnEquip_NoChanging(ModifyInfo modifyInfo);//设备编号Equip_No改变之前发生
        partial void OnEquip_NoChanged(ModifyInfo modifyInfo);//设备编号Equip_No改变之后发生
		partial void OnMsg_SendTimeChanging(ModifyInfo modifyInfo);//信息发布时间Msg_SendTime改变之前发生
        partial void OnMsg_SendTimeChanged(ModifyInfo modifyInfo);//信息发布时间Msg_SendTime改变之后发生
		partial void OnMsg_NoChanging(ModifyInfo modifyInfo);//信息编号Msg_No改变之前发生
        partial void OnMsg_NoChanged(ModifyInfo modifyInfo);//信息编号Msg_No改变之后发生
		partial void OnMsg_RecStatusChanging(ModifyInfo modifyInfo);//信息接收状态Msg_RecStatus改变之前发生
        partial void OnMsg_RecStatusChanged(ModifyInfo modifyInfo);//信息接收状态Msg_RecStatus改变之后发生
		partial void OnExtChanging(ModifyInfo modifyInfo);//备用字段Ext改变之前发生
        partial void OnExtChanged(ModifyInfo modifyInfo);//备用字段Ext改变之后发生
		
		#endregion		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("Equip_MsgSent", "Equip_No", Equip_No);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("Equip_MsgSent", "Equip_No", Equip_No);		
			ManageEditURI = ZModel.InitMEditURI("Equip_MsgSent", "Equip_No", Equip_No);	
		 	ManageDetailURI = ZModel.InitMDetailURI("Equip_MsgSent", "Equip_No", Equip_No);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}